//
// Created by Martin on 2022/12/7.
//

#include <regex>
#include <iostream>
#include <string>

using namespace std;

int main()
{
try {
    // 错误: alnum 漏掉了右括号, 构造函数会抛出异常
    regex r("[[:alnum:]+\\.(cpp|cxx|cc)$", regex::icase);
}
catch (regex_error e) {
    cout << e.what() << "\ncode: " << e.code() << endl;
}

    return 0;
}
